home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 13682 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.5 KB

  1. Path: erich.triumf.ca!bennett
  2. From: bennett@erich.triumf.ca (P.Bennett)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: making #define's to be seen across files
  5. Date: 9 Apr 1996 11:58 PST
  6. Organization: TRIUMF: Tri-University Meson Facility
  7. Distribution: world
  8. Message-ID: <9APR199611584596@erich.triumf.ca>
  9. References: <1996Apr9.164443.28709@relay.nswc.navy.mil>
  10. NNTP-Posting-Host: ftp.triumf.ca
  11. News-Software: VAX/VMS VNEWS 1.50    
  12.  
  13. In article <1996Apr9.164443.28709@relay.nswc.navy.mil>, dheffel@vitds2.nswc.navy.mil writes...
  14. >Hi there,
  15. >    There is (hopefully) a simple answer to my question:
  16. >I have some C code divided into different source files.
  17. >When I try to compile using 
  18. >  "cc file1.c file2.c file3.c"
  19. >the constants #define'd in file1.c are not visible in file2.c, is there a 
  20. >way to make them visible to the other source files?  In other words, is 
  21. >there som equivalent to "extern" for constants?
  22.  
  23. Put anything you want  known to multiple files in a .h file that you #include
  24. in each .c file  (actually, you don't _have_ to call the #included file
  25. something.h, but it is traditional...)
  26.  
  27. Peter Bennett VE7CEI                | Vessels shall be deemed to be in sight
  28. Internet: bennett@triumf.ca         | of one another only when one can be
  29. Packet: ve7cei@ve7kit.#vanc.bc.ca   | observed visually from the other
  30. TRIUMF, Vancouver, B.C., Canada     |                          ColRegs 3(k)
  31. GPS and NMEA info and programs: ftp://sundae.triumf.ca/pub/peter/index.html
  32. or: ftp://ftp-i2.informatik.rwth-aachen.de/pub/arnd/GPS/peter/index.html
  33.  
  34.  
  35.  
  36.  
  37.  
  38.